﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace SkinningSample
{
    class Enemy : ObjectBase
    {
        private Model model;

        public Model Model
        {
            get { return model; }
            set { this.model = value; }
        }

        public override void Update(GameTime gameTime)
        {
            
        }

        public override void  Draw(GameTime gameTime, Matrix view, Matrix projection)
        {
            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    effect.EnableDefaultLighting();

                    effect.World = Matrix.CreateScale(this.Scale) * Matrix.CreateRotationY(this.Rotation) * Matrix.CreateTranslation(this.Position);
                    effect.View = view;
                    effect.Projection = projection;
                }
                mesh.Draw();
            }

        }
    }
}
